LoadMediaIntoRam
TheLoadMediaIntoRam
function loads a media's data into memory.The exact behavior of
LoadMediaIntoRam
is dependent on the media handler.
pascal OSErr LoadMediaIntoRam (Media theMedia, TimeValue time, TimeValue duration, long flags);
theMedia
- Specifies the media for this operation. Your application obtains this media identifier from such Movie Toolbox functions as
NewTrackMedia
andGetTrackMedia
(described on page 2-138 and page 2-190, respectively).time
- Allows you to specify a portion of the media to load. The
time
parameter contains the starting time of the media segment to load. Theduration
parameter specifies the length of the segment to load. This time value must be expressed in the media's time coordinate system.duration
- Allows you to specify a portion of the media to load. The
time
parameter contains the starting time of the media segment to load. Theduration
parameter specifies the length of the segment to load. You can use theGetMediaDuration
function (described on page 2-179) to determine the length of the entire media. Note that the media handler may load more data than you specify if the media data was added in larger pieces.flags
- Gives you explicit control over what is loaded into memory and how long to keep it around. The following constants are provided:
enum { keepInRam = 1<<0, unkeepInRam = 1<<1, flushFromRam = 1<<2, };
- You can set these flags in any combination that makes sense. For descriptions of the individual flag constants, see the description of the
LoadMovieIntoRam
function on page 2-125.DESCRIPTION
If theLoadMediaIntoRam
function fails because it is out of memory, no data is purged.ERROR CODES
File Manager errors
invalidMedia -2008 This media is corrupted or invalid invalidDuration -2014 This duration value is invalid invalidTime -2015 This time value is invalid progressProcAborted -2019 Your progress function returned an error
Memory Manager errors